#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<errno.h>
#include<unistd.h>

#define N 200

int main()
{
    write(1,"请输入文本>>",17);
    char buf[N] = "";
    ssize_t bytes = 0;
    if((bytes = read(0,buf,10))== -1)
    {
        perror("fail to read");
        return -1;
    }
    printf("buf = %s\n",buf);
    printf("bytes = %ld\n",bytes);
    return 0;
}